import request from '@/utils/request'

// 查询换届选举列表
export function listElect(query) {
  return request({
    url: '/elect/list',
    method: 'get',
    params: query
  })
}

// 查询上一条换届选举列表
export function getUpElect(electId) {
  return request({
    url: '/elect/getUpElect/' + electId,
    method: 'get'
  })
}

// 查询下一条换届选举列表
export function getNextElect(electId) {
  return request({
    url: '/elect/getNextElect/' + electId,
    method: 'get'
  })
}

// 查询换届选举详细
export function getElect(electId) {
  return request({
    url: '/elect/' + electId,
    method: 'get'
  })
}

// 新增换届选举
export function addElect(data) {
  return request({
    url: '/elect',
    method: 'post',
    data: data
  })
}

// 修改换届选举
export function updateElect(data) {
  return request({
    url: '/elect',
    method: 'put',
    data: data
  })
}

export function updateElectClick(data) {
  return request({
    url: '/elect/updateClick',
    method: 'put',
    data: data
  })
}

// 删除换届选举
export function delElect(electId) {
  return request({
    url: '/elect/' + electId,
    method: 'delete'
  })
}

// 导出换届选举
export function exportElect(query) {
  return request({
    url: '/elect/export',
    method: 'get',
    params: query
  })
}
